<template>
	<view :class="[primarySize()]">
		<view class="container">
		    <view class="clearfix p30">
		        <view  class="perview_img" v-for="(item,index) in images">
		            <image @click="bindViewImages(index)" :src="cdnurl(item)" mode="aspectFill"></image>
		        </view>
		    </view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				
				images:[]
			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		onLoad() {
			
			 this.getOpenerEventChannel().on('dataTransfer', data=>{
			      this.images = data.images;
			});
		},
		methods: {
			bindViewImages(index){
				let images = this.images;
				for(let i=0;i<images.length;i++){
					images[i] = this.cdnurl(images[i])
				}
				uni.previewImage({
					urls: images,
					current: index
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.perview_img{width: 330rpx;height: 330rpx;display: block;float: left;border-radius: 10rpx;overflow: hidden;margin-bottom: 30rpx}
.perview_img image{width: 100%;height: 100%;display: block}
.perview_img:nth-child(2n){float: right}
</style>
